﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Reflection;
using Pixysoft.Weblications.Sango.Protocol.party;
using Pixysoft.Weblications.Sango.Dao;
using System.Data;
using Pixysoft.Framework.Noebe;
using Pixysoft.Weblications.Sango.Protocol;


namespace Pixysoft.Weblications.Sango.Command.party
{
    partial class SangoPartyHandler
    {
        public party_partyinfo party_partyinfo()
        {
            string userCode = SangoManager.Authentication();
            party_partyinfo response = ReflectionManager.CreatePojo<party_partyinfo>();
            response.Succeed = false;

            Entities.Usr_Partymember member = PartyDao.getActiveMember(userCode);
            string partyCode = member.Partyprimarycode;

            Entities.Usr_Party party = PartyDao.tryGetActiveParty(partyCode);
            response.applycount = PartyDao.GetApplyingMembersCount(partyCode);
            response.totalpartycount = party.Maxmembercount;
            response.partycount = party.Membercount;

            response.Succeed = true;
            return response;
        }
    }

    public interface party_partyinfo : ISangoResponse
    {
        long applycount { get;set;}
        long partycount { get;set;}
        long totalpartycount { get;set;}
    }
}
